import { Injectable  , Type} from '@angular/core';

import {NzModalService, NzMessageService} from 'ng-zorro-antd';

@Injectable()
export class AppModalService {

    constructor(
        private _modal: NzModalService
    ) {

    }

    show(content: string | Type<any>,
        componentParams?: object,
        onOkCallbakc?: () => void ,
    ) {

            const options = {
                content: content,
                wrapClassName: 'modal-lg',
                footer: false,
                componentParams: componentParams
            };
            this
                ._modal
                .open(options)
                .subscribe(result => {
                   
                    if (result === 'onOk') {
                        onOkCallbakc();
                    }
                });


    }
    
}
